const express = require('express')
const body = require('body-parser')

const app = express()
const router = require('./router/index')
const {infoHandler,errorHandler} = require('./middleware/index')
app.use(infoHandler);
// 下面都是为了解析post 传过来的数据 
app.use(body.urlencoded({extended:false}))
app.use(body.json())
app.use('/static',express.static('./client'));
app.use('/api',router);
// /api/users/login
// /api/users/rpwd

app.use(errorHandler);
app.listen(3000,()=>{
    console.log('ok');
})